
package go.tetris.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;


public final class Cube extends Composite {
	private static final int CUBE_SIZE = 16;
	private static final String CUBE_SET = "8blocks-gw-16.png";
	private final Image image = new Image(CUBE_SET, 0, 0, CUBE_SIZE, CUBE_SIZE);
	private int ongo = 0;

	public Cube() {
		initWidget(image);
	}

	public void clear() {
		draw(0);
	}

	public void draw(int n) {
		image.setVisibleRect(n * CUBE_SIZE, 0, CUBE_SIZE, CUBE_SIZE);
	}

	public int getValue() {
		return ongo;
	}

	public void setValue(int n) {
		ongo = n;
	}
}
